
library(testthat)
library(blma)
library(tictoc)
library(parallel)

cores <- detectCores()

test_that("Kakadu produces correct results ZE", {
	Kakadu <- get_Kakadu()
	vy <- Kakadu$vy
	mX <- Kakadu$mX
	tic("Kakadu produces correct results ZE")
	result <- blma(vy, mX, prior="ZE", modelprior="uniform", cores=cores)
	toc()
	expect_equal(result$vinclusion_prob, c(
		0.20355684150991538,0.47244398575065949,0.07485696352142855,
		0.42017464791967363,0.86114935243204360,0.26671059509879097,
		0.08889221213490464,0.11092303936894550,0.07192086903966989,
		0.77777906132245778,0.93733237674906777,0.99937746373248582,
		0.06601135712668889,0.19907890141491377,0.18511189624094807,
		0.75297589180094671,0.08527867659504840,0.74927591041652553,
		0.99999999999929812,0.44106509651296133,0.99999873524470562,
		0.13221495773128050
	), tolerance = 1e-8)
})